<h1>Listing cards</h1>

<table>
  <tr>
    <th>User</th>
    <th>Book</th>
    <th>Date borrowed</th>
    <th>Date due</th>
    <th>Date returned</th>
    <th>Is lost</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @cards.each do |card| %>
  <tr>
    <td><%= card.user_id %></td>
    <td><%= card.book_id %></td>
    <td><%= card.date_borrowed %></td>
    <td><%= card.date_due %></td>
    <td><%= card.date_returned %></td>
    <td><%= card.is_lost %></td>
    <td><%= link_to 'Show', card %></td>
    <td><%= link_to 'Edit', edit_card_path(card) %></td>
    <td><%= link_to 'Destroy', card, confirm: 'Are you sure?', method: :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Card', new_card_path %>
